<?php
require_once "../../Common/database.php";
require_once "../../Common/values.php";

   $result = mysql_query("SELECT * FROM tblUsers WHERE Name='$user'");
   $row = mysql_fetch_array($result);
if($row[s]>1)
{
switch($_GET[f2])
{
case('status');
$query="INSERT INTO tblstatus (Name,Line,Project) VALUES ('$_POST[name]','$_POST[line]','$_POST[project]')";
mysql_query($query);

echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[name];
echo '<p><a href="../../index.php?p=shview">Back</a>';
break;

case('applications');
$query="INSERT INTO tblapplications (Name) VALUES ('$_POST[name]')";
mysql_query($query);

echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[name];
echo '<p><a href="../../index.php?p=shview&f2='.$_GET[f2].'">Back</a>';
break;

case('Projects');
$query="INSERT INTO tblprojects (Name,Users) VALUES ('$_POST[name]','$_POST[users]')";
mysql_query($query);

echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[name];
echo '<p><a href="../../index.php?p=shview">Back</a>';
break;

case('folders');
$query="INSERT INTO tblFolders (Folder) VALUES ('$_POST[name]')";
mysql_query($query);

echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[name];
echo '<p><a href="../../index.php?p=shview">Back</a>';
break;

case('kbfolders');
$query="INSERT INTO tblkbfolders (Folder,Users) VALUES ('$_POST[name]','$_POST[users]')";
mysql_query($query);

echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[name];
echo '<p><a href="../../index.php?p=shview&f2='.$_GET[f2].'">Back</a>';
break;
case('Proirty');
$query="INSERT INTO tblProirty (Name) VALUES ('$_POST[name]')";
mysql_query($query);
#echo $query ;
echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[name];
echo '<p><a href="../../index.php?p=shview">Back</a>';
break;
case('Select');
$query="INSERT INTO tblSelect (`Select`,User,LogNumber,Due,Assigned,Requestor,Subject,Status,Closed,Line,Proirty,Project,Department,Branch,Private) VALUES ('$_POST[select]','$_POST[user]', '$_POST[lognumber]', '$_POST[due]', '$_POST[assigned]', '$_POST[requestor]', '$_POST[subject]', '$_POST[status]', '$_POST[closed]', '$_POST[line]', '$_POST[proirty]', '$_POST[project]', '$_POST[department]', '$_POST[branch]', '$_POST[private]')";
mysql_query($query);

echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[select];
echo '<p><a href="../../index.php?p=shview">Back</a>';
break;

case('dSelect');
$query="INSERT INTO tbldashboard2 (`Select`,User,LogNumber,Due,Assigned,Requestor,Subject,Status,Closed,Line,Proirty,Project,Department,Branch,Private) VALUES ('$_POST[select]','$_POST[user]', '$_POST[lognumber]', '$_POST[due]', '$_POST[assigned]', '$_POST[requestor]', '$_POST[subject]', '$_POST[status]', '$_POST[closed]', '$_POST[line]', '$_POST[proirty]', '$_POST[project]', '$_POST[department]', '$_POST[branch]', '$_POST[private]')";
mysql_query($query);

echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[select];
echo '<p><a href="../../index.php?p=shview">Back</a>';
break;

case('branches');
$query="INSERT INTO tblBranches (ID,BranchNumber,BranchName) VALUES ('$_POST[id]','$_POST[number]','$_POST[name]')";
mysql_query($query);

echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[name];
echo '<p><a href="../../index.php?p=shview">Back</a>';
break;

case('ldap');
$query="INSERT INTO tblldap (dn) VALUES ('$_POST[dn]')";
mysql_query($query);

echo '<h3><center>Added '.$_GET[f2].' > '.$_POST[dn];
echo '<p><a href="../../index.php?p=settings">Back</a>';
break;
}
}
else
{
    echo '<h3>Access Deined</h3>';
}

?>